package com.iflytek.education.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.iflytek.common.annotation.Excel;
import com.iflytek.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * 课程视频对象 edu_video
 *
 * @author isahino
 * @date 2023-09-16
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("edu_video")
public class EduVideo extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 视频ID
     */
    @TableId(type = IdType.ASSIGN_ID)
    private String id;

    /**
     * 课程ID
     */
    private String courseId;

    /**
     * 章节ID
     */
    private String chapterId;

    /**
     * 课时名称
     */
    @Excel(name = "课时名称")
    private String title;

    /**
     * 云端视频资源
     */
    @Excel(name = "云端视频资源")
    private String videoSourceId;

    /**
     * 原始文件名称
     */
    @Excel(name = "原始文件名称")
    private String videoOriginalName;

    /**
     * 排序字段
     */
    @Excel(name = "排序字段")
    private Integer sort;

    /**
     * 播放次数
     */
    @Excel(name = "播放次数")
    private Long playCount;

    /**
     * 开放试听
     */
    @Excel(name = "开放试听")
    private Integer isFree;

    /**
     * 视频时长（秒）
     */
    @Excel(name = "视频时长", readConverterExp = "秒=")
    private Double duration;

    /**
     * 状态
     */
    @Excel(name = "状态")
    private String status;

    /**
     * 视频大小（字节）
     */
    @Excel(name = "视频大小", readConverterExp = "字=节")
    private Long size;

    /**
     * 乐观锁
     */
    @Version
    private Integer version;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @TableField(fill = FieldFill.INSERT)
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date gmtCreate;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date gmtModified;

}
